# Contributor: omni <omni+alpine@hack.org>
# Maintainer: omni <omni+alpine@hack.org>
pkgname=podman-tui
pkgver=0.15.0
pkgrel=0
pkgdesc="Terminal user interface for Podman v4"
url="https://github.com/containers/podman-tui"
license="Apache-2.0"
# podman (netavark & aardvark-dns -> nix crate)
arch="all !s390x"
makedepends="go gpgme-dev linux-headers btrfs-progs-dev lvm2-dev"
depends="podman"
options="!check"
source="$pkgname-$pkgver.tar.gz::https://github.com/containers/podman-tui/archive/v$pkgver.tar.gz"

# secfixes:
#   0.15.0-r0:
#     - CVE-2023-48795

export GOFLAGS="$GOFLAGS -trimpath -mod=readonly -modcacherw"
export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
	# https://github.com/mattn/go-sqlite3/issues/1164
	export CGO_CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"

	go build -v .
}

package() {
	install -Dm0755 "$pkgname" -t "$pkgdir"/usr/bin
}

sha512sums="
2cc313116798cb8f4fbde72d6fddbbb72b50a3f0cdf8732f84ea2fa994ca6ef2649c549e49ef6baa08cdfa488effcb9da84d3235a9dda1c3b101cc05f7e872bc  podman-tui-0.15.0.tar.gz
"
